/* eslint-disable @typescript-eslint/no-explicit-any */
const Colors = {
    Reset: "\x1b[0m",
    Bright: "\x1b[1m",
    Dim: "\x1b[2m",
    Underscore: "\x1b[4m",
    Blink: "\x1b[5m",
    Reverse: "\x1b[7m",
    Red: "\x1b[31m",
    Green: "\x1b[32m",
    Yellow: "\x1b[33m",
    Blue: "\x1b[34m",
    Magenta: "\x1b[35m",
    Cyan: "\x1b[36m",
    White: "\x1b[37m",
    Gray: "\x1b[90m",
    Black: "\x1b[30m",
    Orange: "\x1b[38;5;208m",
}

export function createLogger(name = "tmp") {
    type LoggerArgs = Parameters<typeof console.log>
    function debug(message: string, ...args: LoggerArgs) {
        // if (ENV.dev_mode) {
        console.log(
            `${Colors.Red}[debug]${Colors.Reset}${Colors.Green}[${name}]${Colors.Reset} ${message}`,
            ...args,
        )
        // }
    }

    function info(message: string, ...args: any[]) {
        console.log(
            `${Colors.Blue}[info]${Colors.Reset}${Colors.Green}[${name}]${Colors.Reset} ${message}`,
            ...args,
        )
    }

    return {
        debug,
        info,
    }
}
